﻿using CardInChina.Data.Entity.Interface;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using CardInChina.Data.Entity.Entity;

namespace CardInChina.Test
{


    /// <summary>
    ///This is a test class for CustomerServiceTest and is intended
    ///to contain all CustomerServiceTest Unit Tests
    ///</summary>
    [TestClass()]
    public class CustomerServiceTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Login
        ///</summary>
        [TestMethod()]
        public void LoginTest()
        {


        }


        /// <summary>
        ///A test for GetCustomerByLogInName
        ///</summary>
        [TestMethod()]
        public void GetCustomerByLogInNameTest()
        {
            CustomerService target = new CustomerService(); // TODO: Initialize to an appropriate value
            string account = "77是";
            string password = "User@123";
            Customer expected = null; // TODO: Initialize to an appropriate value
            Customer actual;
            actual = target.Login(account, password);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for Register
        ///</summary>
        [TestMethod()]
        public void RegisterTest()
        {
            CustomerService target = new CustomerService(); // TODO: Initialize to an appropriate value
            string email = "1121@11.com";
            string alias = "xxnn3";
            string password = "User@123";
            string referer = "http://g.cn";
            Nullable<int> recommended = null;
            string ipAddress = "127.0.0.1";

            var actual = target.Register(email, alias, password, referer, recommended, ipAddress);

        }
    }
}
